[jQuery] Get width of element after resizing it
Posted
by infinito
on Stack Overflow
See other posts from Stack Overflow
or by infinito
Published on 2010-04-15T07:29:57Z
Indexed on
2010/04/15
7:33 UTC
Read the original article
Hit count: 158
Hello,
Is it possible to get the size of an element after resizing it using $(el).css()?
My code is:
function resize() {
$(".combobox").css('width', '100%');
var width = $(".combobox").width();
}
I've get the real value of the combobox only after calling the function a second time. The first time is gets the width before executing $(".combobox").css('width', '100%');
I suppose this is fault of the DOM not being recreated after the .css(). Is there any way to force DOM reloading?
Thanks in advance!
© Stack Overflow or respective owner